<template>
  <div class="goods-info" @click="goGoodsPage()">
    <div class="goods-image">
      <img v-lazy="goodsImage" width="90%">
    </div>
    <div class="goods-name">{{goodsName}}</div>
    <div class="goods-price">&yen;{{goodsPrice | moneyFilter}}</div>
  </div>
</template>

<script>
import { toMoney } from '@/filter/moneyFilter'

export default {
  props: ['goodsImage', 'goodsName', 'goodsPrice', 'goodsId'],
  filters: {
    moneyFilter (money) {
      return toMoney(money)
    }
  },
  data () {
    return {

    }
  },
  methods: {
    goGoodsPage () {
      this.$router.push({ name: 'Goods', query: { goodsId: this.goodsId } })
    }
  },
  components: {

  }
}
</script>

<style scoped>
.goods-name {
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
</style>
